package com.robot.job;

import com.robot.service.RobotService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class ScheduledService {

    @Autowired
    private RobotService robotService;
    @Scheduled(cron = "0 0 5 * * ?")

    //每日五点定时更新机器人星级
    public void scheduled(){
        //获得变化的机器人数量
        Integer records = robotService.updateRobotHeatStars();
        log.info("=====>>>>>更新机器人数量：  {}",records);
    }

}
